@Body Single@<-!><:f180,2Times New Roman,0,0,0><-!><-!><-!><-!>//*****************************************************************************
@Body Single@<:f180,2Times New Roman,0,0,0>// PROJECT: Print current<:f><:f180,2Times New Roman,0,0,0> document Delrina WinFax<:f><:f180,2Times New Roman,0,0,0> PRO
@Body Single@<:f180,2Times New Roman,0,0,0>// TITLE : PRN2WNFX.SMM<:f>
@Body Single@<:s><:f180,2Times New Roman,0,0,0>// VERSION: 2<:f><:f180,2Times New Roman,0,0,0>.0
@Body Single@<:s><:f180,2Times New Roman,0,0,0>// AUTHOR: Delrina Corporation
@Body Single@<:s><:f180,2Times New Roman,0,0,0>// MODIFIED: April 5, 1994<:f><:f180,2Times New Roman,0,0,0><:f>
@Body Single@<:f180,2Times New Roman,0,0,0>//*****************************************************************************
@Body Single@<:f180,2Times New Roman,0,0,0>/*
@Body Single@<:s><:f180,2Times New Roman,0,0,0>For use with Ami Pro 3.0<:f>
@Body Single@<:s>Modifications:
@Body Single@ April 5, 1994 - Added a required line to initiate the conversation WinFax after it has been loaded. (The BWagner fix.)
@Body Single@ - Modified first line in each wfx style search section. (Makes macro a littler smarter.)
@Body Single@<:s> - Lowered the pause time after WinFax is launched.
@Body Single@ - If DDE conversation cannot be initiated, then macro will attempt a simple print.
@Body Single@<:f180,2Times New Roman,0,0,0> */<:f>
@Body Single@<:s><+!><:f200,2Times New Roman,0,0,255>
@Function@<:f200,2Times New Roman,0,0,0>FUNCTION WINFAX1()<:f>
<:f180,2Times New Roman,>' SingleStep(1)<:f>
<:f200,2Times New Roman,0,0,0>DefPrn =GetProfileString$("windows","device")<:f><:f200,2Times New Roman,0,0,0> <:f200,2Times New Roman,255,0,0>'get
<:f><:f200,2Times New Roman,255,0,0>default print device prior to WinFax selection<:f>
<:f200,2Times New Roman,0,0,0>SavPrn =<:f200,2Times New Roman,0,0,0>(<:f200,2Times New Roman,0,0,0>Right$(DefPrn<:f200,2Times New Roman,0,0,0>,(Len(DefPrn<:f200,2Times New Roman,0,0,0>) - InStr(0,DefPrn<:f200,2Times New Roman,0,0,0>, ",")))<:f200,2Times New Roman,0,0,0>
)<:f200,2Times New Roman,0,0,0> <:f200,2Times New Roman,255,0,0>'<:f><:f200,2Times New Roman,255,0,0> eg. hppcl5a,LPT1:
<:f200,2Times New Roman,0,0,0>RepPrn =Strcat$(CHR$(<:f200,2Times New Roman,0,0,0>34),<:f200,2Times New Roman,0,0,0>Left$(SavPrn<:f200,2Times New Roman,0,0,0>,(InStr(0,SavPrn<:f200,2Times New Roman,0,0,0>, ","))<:f200,2Times New Roman,0,0,0> - 1),CHR$(34),CH
R$(44),CHR$(34),<:f200,2Times New Roman,0,0,0>Right$(SavPrn<:f200,2Times New Roman,0,0,0>,(Len(SavPrn<:f200,2Times New Roman,0,0,0>) - InStr(0,SavPrn<:f200,2Times New Roman,0,0,0>, ",")))<:f200,2Times New Roman,0,0,0>,CHR$(34))<:f><:f200,2Times New Roman,0,0,0>
<:f200,2Times New Roman,255,0,0>'(<+">above<-">) RepPrn reformats SavPrn
<:f><:f200,2Times New Roman,255,0,0> eg. "hppcl5a","LPT1"
<+@><:S+-1><:f200,2Times New Roman,0,0,0>FaxDevice =GetProfileString$("devices", "WINFAX",) <:f200,2Times New Roman,255,0,0>'Get WinFax assignment from
<:f><:f200,2Times New Roman,255,0,0> Win.ini<:f><:f200,2Times New Roman,255,0,0>. eg. WINFAX,COM2:
<+@><:S+-1><:f200,2Times New Roman,0,0,0>PrintSetup("WINFAX" ,<:f200,2Times New Roman,0,0,0>(<:f200,2Times New Roman,0,0,0>Right$(FaxDevice,(Len(FaxDevice) - InStr(0,FaxDevice, ",")))<:f200,2Times New Roman,0,0,0>)<:f200,2Times New Roman,0,0,0> )<:f200,2Times New Roman,0,0,0>
<:f200,2Times New Roman,255,0,0>'Format for<:f><:f200,2Times New Roman,255,0,0> PrintSetup<:f><:f200,2Times New Roman,255,0,0> eg. "WINFAX","COM2"
<+@><:s><:S+-1><:f200,2Times New Roman,255,0,0>
<:s><:S+-1><:f200,2Times New Roman,255,0,0>' Find the Fax Number<:f>
<:f200,2Times New Roman,>Type( "<[>CTRLHome]" )<:f>
<:f200,2Times New Roman,>retcode = Replace(0, 0, 2<:f><:f200,2Times New Roman,>, "wfxFaxNum<:f><:f200,2Times New Roman,>", "")<:f>
<:f200,2Times New Roman,>If retcode = 1
<:f200,2Times New Roman,> If Curshade$() != ""<:f>
<:f200,2Times New Roman,> StatusBarMsg("WinFax<:f><:f200,2Times New Roman,> DDE style keys found.")<:f>
<:f200,2Times New Roman,> <:f><:f180,2Times New Roman,>faxnum = Strcat$(Chr$(34),<:f180,2Times New Roman,>CurShade$()<:f180,2Times New Roman,>,Chr$(34)<:f><:f180,2Times New Roman,>)<:f>
<:f200,2Times New Roman,>Type( "<[>CTRLHome]" )<:f>
<:S+-1><:f180,2Times New Roman,> FaxApp$ = <:f180,2Times New Roman,>Strcat$<:f180,2Times New Roman,>(<:f180,2Times New Roman,>GetProfileString$("WinFax<:f180,2Times New Roman,>", "ExePath<:f><:f180,2Times New Roman,>"<:f180,2Times New Roman,>),<:f><:f180,2Times New Roman,>
"Faxmng.exe<:f><:f180,2Times New Roman,> -q<:f><:f180,2Times New Roman,>")<:f>
<:S+-1><:f180,2Times New Roman,> <:f><:f180,2Times New Roman,>Id2 = DDEInitiate("FAXMNG", "TRANSMIT<:f180,2Times New Roman,>")<:f>
<:f200,2Times New Roman,> StatusBarMsg("<:f><:f200,2Times New Roman,>")<:f>
<:f180,2Times New Roman,> <:f200,2Times New Roman,>IF Id2 = 0
<:f200,2Times New Roman,> StatusBarMsg("Loading Delrina WinFax<:f><:f200,2Times New Roman,>...")
<:f200,2Times New Roman,255,0,0> <:f200,2Times New Roman,> Exec(FaxApp$<:f><:f200,2Times New Roman,>, 7<:f><:f200,2Times New Roman,><:f><:f200,2Times New Roman,>)
<:f180,2Times New Roman,> Pause(03<:f><:f180,2Times New Roman,><:f><:f180,2Times New Roman,>0)
<:f200,2Times New Roman,> StatusBarMsg("<:f><:f200,2Times New Roman,>")<:f>
<:f180,2Times New Roman,><:f><:f180,2Times New Roman,><:f180,2Times New Roman,>FOR I = 1 to 10<:f>
<:f180,2Times New Roman,> Id2 = DDEInitiate("FAXMNG", "TRANSMIT<:f180,2Times New Roman,>")<:f>
<:f180,2Times New Roman,><:f180,2Times New Roman,> IF Id2<:f><:f180,2Times New Roman,> <;> 0
<:f180,2Times New Roman,> ok<:f><:f180,2Times New Roman,> = TRUE
<:f180,2Times New Roman,> BREAK
<:f180,2Times New Roman,> ENDIF
<:f180,2Times New Roman,> NEXT
<:f180,2Times New Roman,> IF not ok<:f>
<:f180,2Times New Roman,> Message("Could not initiate a conversation with WinFax!")
<:f180,2Times New Roman,> Goto doprint<:f><:f180,2Times New Roman,> <:f180,2Times New Roman,255,0,0>' If we can't load WinFax then just print<:f><:f180,2Times New Roman,255,0,0>.
<:f180,2Times New Roman,> ENDIF<:f><:f180,2Times New Roman,>
<:f180,2Times New Roman,> ENDIF<:f>
<:f200,2Times New Roman,> EndIf
<:s><:f200,2Times New Roman,>Else
<:f200,2Times New Roman,0,0,0> <:f><:f180,2Times New Roman,>Goto doprint<:f><:f180,2Times New Roman,> <:f180,2Times New Roman,255,0,0>' If no fax number is found<:f><:f180,2Times New Roman,255,0,0> print document.<:f>
<:f180,2Times New Roman,>EndIf
<:s><:S+-1><:f180,2Times New Roman,255,0,0>
<:s><:S+-1><:f180,2Times New Roman,255,0,0>' find the recipient name<:f>
<:f200,2Times New Roman,>recipient =<:f><:f180,2Times New Roman,> Strcat$(Chr$(34),<:f180,2Times New Roman,>"To Whom it may concern"<:f><:f180,2Times New Roman,>,Chr$(34)<:f><:f180,2Times New Roman,>)<:f>
<:f200,2Times New Roman,>retcode = Replace(0, 0, 2<:f><:f200,2Times New Roman,>, "wfxRecipient<:f><:f200,2Times New Roman,>", "")<:f>
<:f200,2Times New Roman,>If retcode = 1
<:f200,2Times New Roman,> If Curshade$() != ""<:f>
<:f200,2Times New Roman,> <:f><:f180,2Times New Roman,> recipient = Strcat$(<:f><:f180,2Times New Roman,>Chr$(44)<:f><:f180,2Times New Roman,>,Chr$(34),<:f180,2Times New Roman,>CurShade$()<:f180,2Times New Roman,>,Chr$(34)<:f><:f180,2Times New Roman,>)<:f>
<:f180,2Times New Roman,> EndIf
<:f200,2Times New Roman,>EndIf<:f>
<:s><:f200,2Times New Roman,>Type( "<[>Home]" )
<:s>
<:s><:f180,2Times New Roman,255,0,0>' Find the fax Time
<:f200,2Times New Roman,>ftime = <:f><:f180,2Times New Roman,>Strcat$(Chr$(44),Chr$(34),Chr$(34)<:f><:f180,2Times New Roman,>)
<:f200,2Times New Roman,>retcode = Replace(0, 0, 2<:f><:f200,2Times New Roman,>, "wfxTime<:f><:f200,2Times New Roman,>", "")<:f>
<:f200,2Times New Roman,>If retcode = 1
<:f200,2Times New Roman,> If Curshade$() != ""<:f>
<:f200,2Times New Roman,> <:f><:f180,2Times New Roman,>ftime<:f><:f180,2Times New Roman,> = Strcat$(<:f><:f180,2Times New Roman,>Chr$(44)<:f><:f180,2Times New Roman,>,<:f><:f180,2Times New Roman,>Chr$(34),<:f180,2Times New Roman,>CurShade$()<:f180,2Times New Roman,>
,Chr$(34)<:f><:f180,2Times New Roman,>)<:f>
<:f180,2Times New Roman,> EndIf
<:f180,2Times New Roman,>EndIf
<:s><:f200,2Times New Roman,>Type( "<[>Home]" )<:f>
<:s>
<:s><:f180,2Times New Roman,255,0,0>' Find the fax Date<:f>
<:f200,2Times New Roman,>fdate = <:f><:f180,2Times New Roman,>Strcat$(Chr$(44),Chr$(34),Chr$(34)<:f><:f180,2Times New Roman,>)<:f>
<:f200,2Times New Roman,>retcode = Replace(0, 0, 2<:f><:f200,2Times New Roman,>, "wfxDate<:f><:f200,2Times New Roman,>", "")<:f>
<:f200,2Times New Roman,>If retcode = 1
<:f200,2Times New Roman,> If CurShade$() != ""<:f>
<:f200,2Times New Roman,> <:f><:f180,2Times New Roman,>fdate<:f><:f180,2Times New Roman,> = Strcat$(<:f><:f180,2Times New Roman,>Chr$(44)<:f><:f180,2Times New Roman,>,<:f><:f180,2Times New Roman,>Chr$(34),<:f180,2Times New Roman,>CurShade$()<:f180,2Times New Roman,>
,Chr$(34)<:f><:f180,2Times New Roman,>)<:f>
<:f200,2Times New Roman,> EndIf
<:f180,2Times New Roman,>EndIf
<:s><:f200,2Times New Roman,>Type( "<[>Home]" )<:f>
<:s>
<:s><:f180,2Times New Roman,255,0,0>' Find the Company Name<:f>
<:f200,2Times New Roman,>company = <:f><:f180,2Times New Roman,>Strcat$(<:f><:f180,2Times New Roman,>Chr$(44),<:f><:f180,2Times New Roman,>Chr$(34),Chr$(34)<:f><:f180,2Times New Roman,>)<:f>
<:f200,2Times New Roman,>retcode = Replace(0, 0, 2<:f><:f200,2Times New Roman,>, "wfxCompany<:f><:f200,2Times New Roman,>", "")<:f>
<:f200,2Times New Roman,>If retcode = 1
<:f200,2Times New Roman,> If CurS<:f><:f200,2Times New Roman,>hade$() != ""<:f>
<:f200,2Times New Roman,> <:f><:f180,2Times New Roman,>company<:f><:f180,2Times New Roman,> = Strcat$(<:f><:f180,2Times New Roman,>Chr$(44),<:f><:f180,2Times New Roman,>Chr$(34),<:f180,2Times New Roman,>CurShade$()<:f180,2Times New Roman,>,Chr$(34)<:f><:f180,2Times New Roman,>
)<:f>
<:f180,2Times New Roman,> EndIf
<:f180,2Times New Roman,>EndIf
<:s><:f200,2Times New Roman,>Type( "<[>Home]" )<:f>
<:s>
<:s><:f180,2Times New Roman,255,0,0>' Find the Subject<:f>
<:f200,2Times New Roman,>subject = <:f><:f180,2Times New Roman,> <:f><:f180,2Times New Roman,>Strcat$(Chr$(44),Chr$(34),Chr$(34)<:f><:f180,2Times New Roman,>)<:f>
<:f200,2Times New Roman,>retcode = Replace(0, 0, 2<:f><:f200,2Times New Roman,>, "wfxSubject<:f><:f200,2Times New Roman,>", "")<:f>
<:f200,2Times New Roman,>If retcode = 1
<:f200,2Times New Roman,> <:f><:f180,2Times New Roman,>subject<:f><:f180,2Times New Roman,> =<:f><:f180,2Times New Roman,> Strcat$(<:f><:f180,2Times New Roman,>Chr$(44),<:f><:f180,2Times New Roman,>Chr$(34)<:f><:f180,2Times New Roman,>,<:f180,2Times New Roman,>
CurS<:f><:f180,2Times New Roman,>hade$<:f><:f180,2Times New Roman,>()<:f180,2Times New Roman,>,Chr$(34)<:f><:f180,2Times New Roman,>)<:f>
<:f180,2Times New Roman,>EndIf
<:s><:f200,2Times New Roman,>Type( "<[>Home]" )<:f>
<:s>
<:s><:f180,2Times New Roman,255,0,0>' Find the Key<:f><:f180,2Times New Roman,255,0,0>word<:f>
<:f200,2Times New Roman,>keyword<:f><:f200,2Times New Roman,> = <:f><:f180,2Times New Roman,>Strcat$(Chr$(44),Chr$(34),Chr$(34)<:f><:f180,2Times New Roman,>)
<:f200,2Times New Roman,>retcode = Replace(0, 0, 2<:f><:f200,2Times New Roman,>, "wfxKey<:f><:f200,2Times New Roman,>Word<:f><:f200,2Times New Roman,>", "")<:f>
<:f200,2Times New Roman,>If retcode = 1
<:f200,2Times New Roman,> If CurShade$() != ""<:f>
<:f200,2Times New Roman,> <:f><:f180,2Times New Roman,>keyword<:f><:f180,2Times New Roman,> = Strcat$(<:f><:f180,2Times New Roman,>Chr$(44),<:f><:f180,2Times New Roman,>Chr$(34),<:f180,2Times New Roman,>CurS<:f><:f180,2Times New Roman,>hade$()<:f180,2Times New Roman,>
,Chr$(34)<:f><:f180,2Times New Roman,>)<:f>
<:f180,2Times New Roman,> EndIf
<:f180,2Times New Roman,>EndIf
<:s><:f200,2Times New Roman,>Type( "<[>Home]" )<:f>
<:s>
<:s><:f180,2Times New Roman,255,0,0>' Find the Billing Code<:f>
<:f200,2Times New Roman,>billcode<:f><:f200,2Times New Roman,> = <:f><:f180,2Times New Roman,>Strcat$(Chr$(44),Chr$(34),Chr$(34)<:f><:f180,2Times New Roman,>)
<:f200,2Times New Roman,>retcode = Replace(0, 0, 2<:f><:f200,2Times New Roman,>, "wfxBillCode<:f><:f200,2Times New Roman,>", "")<:f>
<:f200,2Times New Roman,>If retcode = 1
<:f200,2Times New Roman,> If Curshade$() != ""<:f>
<:f200,2Times New Roman,> <:f><:f180,2Times New Roman,>billcode<:f><:f180,2Times New Roman,> = Strcat$(<:f><:f180,2Times New Roman,>Chr$(44),<:f><:f180,2Times New Roman,>Chr$(34),<:f180,2Times New Roman,>CurShade$()<:f180,2Times New Roman,>,Chr$(34)<:f><:f180,2Times New Roman,>
)<:f>
<:f180,2Times New Roman,> EndIf
<:f180,2Times New Roman,>EndIf
<:s><:f200,2Times New Roman,>Type( "<[>Home]" )<:f>
<:s>
<:f180,2Times New Roman,>Type("<[>Right]")
<+@><:s><:S+-1><:f180,2Times New Roman,>
<+@><:S+-1><:f180,2Times New Roman,>SendTo = <:f><:f180,2Times New Roman,>Strcat$(<:f><:f180,2Times New Roman,>"recipient",Chr$(40),<:f><:f180,2Times New Roman,>faxnum,<:f><:f180,2Times New Roman,>ftime<:f180,2Times New Roman,>,<:f><:f180,2Times New Roman,>fdate,<:f><:f180,2Times New Roman,>
recipient,company,subject,<:f><:f180,2Times New Roman,>keyword,<:f><:f180,2Times New Roman,>billcode,<:f><:f180,2Times New Roman,>Chr$(41))<:f>
<:S+-1><:f180,2Times New Roman,>DDEPoke(Id2, "Sendfax", SendTo)<:f>
<:s><:S+-1><:f180,2Times New Roman,>
<:s><:S+-1><:f180,2Times New Roman,>mode = 0 <:f180,2Times New Roman,255,0,0> ' Do not show WinFax Send dialog<:f>
<:S+-1><:f180,2Times New Roman,>If <:f><:f180,2Times New Roman,>Decide<:f><:f180,2Times New Roman,>(<:f><:f180,2Times New Roman,>"Display WinFax Send dialog?","Print to Delrina WinFax")<:f>
<:s><:S+-1><:f180,2Times New Roman,> mode = 1 <:f><:f180,2Times New Roman,255,0,0> ' S<:f><:f180,2Times New Roman,255,0,0>how WinFax Send dialog<:f>
<:S+-1><:f180,2Times New Roman,> showsenddlg = Strcat$("showsendscreen"<:f><:f180,2Times New Roman,>,Chr$(40)<:f><:f180,2Times New Roman,>,Chr$(34),mode,<:f><:f180,2Times New Roman,>Chr$(34)<:f><:f180,2Times New Roman,>,<:f><:f180,2Times New Roman,>Chr$(41)<:f><:f180,2Times New Roman,>
)<:f>
<:S+-1><:f180,2Times New Roman,> DDEPoke(Id2, "Sendfax", <:f><:f180,2Times New Roman,>showsenddlg<:f180,2Times New Roman,>)
<:S+-1><:f180,2Times New Roman,> <:f180,2Times New Roman,>FilePrint(1, 1, 9999, 1537) <:f180,2Times New Roman,255,0,0>' Do default print, no print dialog<:f>
<:S+-1><:f180,2Times New Roman,> D<:f180,2Times New Roman,>DETerminate(Id2)<:f>
<:s><:S+-1><:f180,2Times New Roman,>Else
<:S+-1><:f180,2Times New Roman,> doprint:
<+@><:S+-1><:f200,2Times New Roman,0,0,0> FilePrint <:f200,2Times New Roman,255,0,0>'Open Print dialog.
<:S+-1><:f180,2Times New Roman,>EndIf<:f>
<+@><:S+-1><:f200,2Times New Roman,0,0,0> PrintSetup(RepPrn) <:f200,2Times New Roman,255,0,0>'Put the focus back on the printer selected before the print to WinFax. eg. "hppcl5a","LPT1:"<:f>
@Function@<:f200,2Times New Roman,0,0,0>END FUNCTION<:f>
>
[Embedded]
00017665
>
[macsum] 1
WINFAX1 0 0 21 16
[macse]
14 WINFAX1
0 286 "windows" "device"
13
8 1
0 14 "{1}"
13
0 808 0 "{1}" ","
13
3 1
0 807 "{1}" [X]
13
8 2
0 39 34
13
0 808 0 "{2}" ","
13
5 1
3 1
0 806 "{2}" [X]
13
0 39 34
13
0 39 44
13
0 39 34
13
0 14 "{2}"
13
0 808 0 "{2}" ","
13
3 1
0 807 "{2}" [X]
13
0 39 34
13
0 16 [X] [X] [X] [X] [X] [X] [X]
13
8 3
0 286 "devices" "WINFAX"
13
8 4
0 14 "{4}"
13
0 808 0 "{4}" ","
13
3 1
0 807 "{4}" [X]
13
2 112 1 "WINFAX" [X]
0 6 "[16420]"
2 488 1 0 0 2 "wfxFaxNum" ""
13
8 5
6 5
5 1
18 0
11 00001198
0 24
13
7 ""
18 1
11 00001185
0 789 "WinFax DDE style keys found."
0 39 34
13
0 24
13
0 39 34
13
0 16 [X] [X] [X]
13
8 6
0 6 "[16420]"
0 286 "WinFax" "ExePath"
13
0 16 [X] "Faxmng.exe -q"
13
8 7
0 8 "FAXMNG" "TRANSMIT"
13
8 8
0 789 ""
6 8
5 0
18 0
11 00001185
0 789 "Loading Delrina WinFax..."
0 22 "{7}" 7
0 274 030
0 789 ""
5 1
8 9
5 10
6 9
18 2
12 00000994
10 00001094
5 1
6 9
3 0
8 9
10 00000918
0 8 "FAXMNG" "TRANSMIT"
13
8 8
6 8
5 0
18 3
11 00001081
5 1
8 10
10 00001094
10 00000961
6 10
1 3
11 00001185
0 3 "Could not initiate a conversation with WinFax!"